function request = compute_request(Par,vphi,mz,agg,mlabor)
% Computes union's request given equilibrium values
% Output:
%   request - 1 by ngoods vector of union's requests
% Input:
%   Par - parameter structure
%   vphi - 1 by ngoods vector of parameter phi for each Home firm
%   mz - 2 by ngoods productivity matrix. 
%%   Note: first row of mz is the cutoff productivity level ztildeH
%   agg - 1 by 3 vector of solution for aggregate variables
%   ml - 4 by ngoods matrix of labor allocation
    sigma = Par.sigma;
    rho = Par.rho;
    tau = Par.tau;
    kappa = Par.kappa;
    % Compute equilibrium variables when realized Home productivity shocks
    % are at the cutoff level
    y_nostrike = mlabor.*kron(mz,[1;1])./[1;tau;tau;1]; % 4 by ngoods matrix of output levels without strikes
    y_strike = y_nostrike.*kron([1-kappa;1],[1;1]); % 4 by ngoods matrix of output levels with strikes
    ysector_nostrike = [(y_nostrike(1,:).^((rho-1)/rho)+y_nostrike(3,:).^((rho-1)/rho)).^(rho/(rho-1));(y_nostrike(2,:).^((rho-1)/rho)+y_nostrike(4,:).^((rho-1)/rho)).^(rho/(rho-1))];
    ysector_strike = [(y_strike(1,:).^((rho-1)/rho)+y_strike(3,:).^((rho-1)/rho)).^(rho/(rho-1));(y_strike(2,:).^((rho-1)/rho)+y_strike(4,:).^((rho-1)/rho)).^(rho/(rho-1))];
    psector_nostrike = ([agg(1);agg(2)]./ysector_nostrike).^(1/sigma);
    psector_strike = ([agg(1);agg(2)]./ysector_strike).^(1/sigma);
    p_nostrike = repmat(psector_nostrike.*ysector_nostrike.^(1/rho),2,1)./y_nostrike.^(1/rho)./[1;tau;tau;1]; % 4 by ngoods origin-destination level prices without strikes
    p_strike = repmat(psector_strike.*ysector_strike.^(1/rho),2,1)./y_strike.^(1/rho)./[1;tau;tau;1]; % 4 by ngoods origin-destination level prices with strikes
    % Compute profits of Home firms with/without strikes
    % The following 2 objects are 1 by ngoods vectors of profits
    profits_nostrike = sum([1;tau].*p_nostrike(1:2,:).*y_nostrike(1:2,:) - mlabor(1:2,:),1);
    profits_strike = sum([1;tau].*p_strike(1:2,:).*y_strike(1:2,:) - (1-kappa).*mlabor(1:2,:),1);
    % The level of request, by equation (42) in the notes
    request = profits_nostrike - (1-vphi).*profits_strike;
end